/*
 * @(#)MaintDmsClipBoardUpdateAlertForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.alert.bean.UpdateAlert;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;

/**
  MaintDmsClipBoardUpdateAlertForm.java

  This class is the for web form purpose.

  @author      Weison Liang
  @company     DCIVision Limited
  @creation date   07/12/2004
  @version     $Revision: 1.1 $
*/

public class MaintDmsClipBoardUpdateAlertForm extends com.dcivision.alert.web.MaintUpdateAlertForm {

  public static final String REVISION = "$Revision: 1.1 $";

  private String alertTime = null;
  private String alertTimeType = null;
  private String status = null;
  private String recurEvent = null;
  private String readFlag = null;

  //For display Document
  private String parentID = null;
  private String rootID = null;
  private String documentType = null;
  private String directURL=null;

  public MaintDmsClipBoardUpdateAlertForm() {
    super();
  }

  public String getAlertTime() {
    return(this.alertTime);
  }

  public void setAlertTime(String alertTime) {
    this.alertTime = alertTime;
  }

  public String getAlertTimeType() {
    return(this.alertTimeType);
  }

  public void setAlertTimeType(String alertTimeType) {
    this.alertTimeType = alertTimeType;
  }


  public String getStatus() {
    return(this.status);
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public String getRecurEvent() {
    return(this.recurEvent);
  }

  public void setRecurEvent(String recurEvent) {
    this.recurEvent = recurEvent;
  }

  public String getReadFlag() {
    return(this.readFlag);
  }

  public void setReadFlag(String readFlag) {
    this.readFlag = readFlag;
  }

  public String getParentID() {
    return(this.parentID);
  }

  public void setParentID(String parentID) {
    this.parentID = parentID;
  }

  public String getRootID() {
    return(this.rootID);
  }

  public void setRootID(String rootID) {
    this.rootID = rootID;
  }

  public String getDocumentType() {
    return(this.documentType);
  }

  public void setDocumentType(String documentType) {
    this.documentType = documentType;
  }
  
  public String getDirectURL(){
    return this.directURL;
  }
  
  public void setDirectURL(String directURL){
    this.directURL=directURL; 
  }

  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setObjectType(null);
    this.setObjectID(null);
    this.setAlertTime(null);
    this.setAlertTimeType(null);
    this.setStatus(null);
    this.setRecurEvent(null);
    this.setReadFlag(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);

  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    super.getFormData();
    UpdateAlert tmpUpdateAlert = new UpdateAlert();
    tmpUpdateAlert.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpUpdateAlert.setObjectType(this.getObjectType());
    tmpUpdateAlert.setObjectID(TextUtility.parseIntegerObj(this.getObjectID()));
    tmpUpdateAlert.setAlertTime(TextUtility.parseIntegerObj(this.getAlertTime()));
    tmpUpdateAlert.setAlertTimeType(this.getAlertTimeType());
    tmpUpdateAlert.setStatus(this.getStatus());
    tmpUpdateAlert.setRecurEvent(this.getRecurEvent());
    tmpUpdateAlert.setRecordStatus(this.getRecordStatus());
    tmpUpdateAlert.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpUpdateAlert.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpUpdateAlert.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpUpdateAlert.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpUpdateAlert.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpUpdateAlert;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    super.setFormData(baseObj);
    UpdateAlert tmpUpdateAlert = (UpdateAlert)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpUpdateAlert.getID()));
    this.setObjectType(tmpUpdateAlert.getObjectType());
    this.setObjectID(TextUtility.formatIntegerObj(tmpUpdateAlert.getObjectID()));
    this.setAlertTime(TextUtility.formatIntegerObj(tmpUpdateAlert.getAlertTime()));
    this.setAlertTimeType(tmpUpdateAlert.getAlertTimeType());
    this.setStatus(tmpUpdateAlert.getStatus());
    this.setRecurEvent(tmpUpdateAlert.getRecurEvent());
    this.setRecordStatus(tmpUpdateAlert.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpUpdateAlert.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpUpdateAlert.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpUpdateAlert.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpUpdateAlert.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpUpdateAlert.getUpdateDate()));
  }
}
